import { createRouter, createWebHistory } from 'vue-router'

const routes = [
  {
    path: '/',
    redirect: '/login'
  },
  {
    path: '/login',
    name: 'Login',
    component: () => import('../views/Login.vue')
  },
  {
    path: '/home',
    name: 'Home',
    component: () => import('../views/Home.vue'),
    children: [
      {
        path: '',
        redirect: '/home/brand'
      },
      {
        path: 'brand',
        name: 'Brand',
        component: () => import('../views/Brand.vue')
      },
      {
        path: 'training',
        name: 'Training',
        component: () => import('../views/Training.vue')
      },
      {
        path: 'accessories',
        name: 'Accessories',
        component: () => import('../views/Accessories.vue')
      },
      {
        path: 'cart',
        name: 'Cart',
        component: () => import('../views/Cart.vue')
      },
      {
        path: 'orders',
        name: 'Orders',
        component: () => import('../views/OrderManagement.vue')
      }
    ]
  },
  {
    path: '/checkout',
    name: 'Checkout',
    component: () => import('../views/Checkout.vue')
  }
]

const router = createRouter({
  history: createWebHistory(),
  routes
})

export default router 